package com.w7vm.menuweb.entity;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Date;
import java.util.List;

/**
 * The persistent class for the CardapioSelfServiceWeb database table.
 * 
 */
@Entity
@NamedQueries({
	@NamedQuery(name="CardapioSelfService.findCardapioSelfServiceByIDSede", 
			query="SELECT ss" +
					" FROM CardapioSelfServiceWeb ss" +
					" JOIN ss.restauranteSedeWeb s " +
					" WHERE s.idRestauranteSedeWeb = :idRestaurante"),

	@NamedQuery(name="CardapioSelfService.findCardapioSelfServiceByIDFilial", 
					query="SELECT ss" +
							" FROM CardapioSelfServiceWeb ss" +
							" JOIN ss.restauranteFilialWeb f " +
							" WHERE f.idRestauranteFilialWeb = :idRestaurante"),
	
	@NamedQuery(name="CardapioSelfService.findCardapioSelfServiceByID", 
							query="SELECT ss" +
									" FROM CardapioSelfServiceWeb ss" +
									" WHERE ss.idCardapioSelfServiceWeb = :idCardapioSelfServiceWeb"),

})
public class CardapioSelfServiceWeb implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String FIND_SELFSERVICE_BY_IDRESTAURANTESEDE = "CardapioSelfService.findCardapioSelfServiceByIDSede";
	public static final String FIND_SELFSERVICE_BY_IDRESTAURANTEFILIAL = "CardapioSelfService.findCardapioSelfServiceByIDFilial";
	public static final String FIND_SELFSERVICE_BY_ID = "CardapioSelfService.findCardapioSelfServiceByID";

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int idCardapioSelfServiceWeb;

	@Column(name="NomeSelfService")
	private String nomeSelfService;

	@Column(name="Cortesia")
	private String cortesia;

    @Temporal( TemporalType.DATE)
	@Column(name="DtInicio")
	private Date dtInicio;
    
    @Temporal( TemporalType.DATE)
	@Column(name="DtCadastro")
	private Date dtCadastro;

    @Temporal( TemporalType.DATE)
	@Column(name="DtTermino")
	private Date dtTermino;

	@Column(name="EntradasFrias")
	private String entradasFrias;

	@Column(name="EntradasQuentes")
	private String entradasQuentes;

	@Column(name="Sobremesa")
	private String sobremesa;

	@Column(name="Status")
	private int status;
	
	@Column(name="DiasSemana")
	private String diasSemana;

	//bi-directional many-to-one association to RestauranteFilialWeb
    @ManyToOne
	@JoinColumn(name="idRestauranteFilial")
	private RestauranteFilialWeb restauranteFilialWeb;

	//bi-directional many-to-one association to RestauranteSedeWeb
    @ManyToOne
	@JoinColumn(name="idRestauranteSede")
	private RestauranteSedeWeb restauranteSedeWeb;

	//bi-directional many-to-one association to ComposicaoCardSelfServiceWeb
//	@OneToMany(mappedBy="cardapioSelfServiceWeb",cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	
	@OneToMany(mappedBy="cardapioSelfServiceWeb",fetch=FetchType.EAGER, cascade=CascadeType.ALL, orphanRemoval=true)
	private List<ComposicaoCardSelfServiceWeb> composicaoCardSelfServiceWebs;

    public CardapioSelfServiceWeb() {
    }

	public int getIdCardapioSelfServiceWeb() {
		return this.idCardapioSelfServiceWeb;
	}

	public void setIdCardapioSelfServiceWeb(int idCardapioSelfServiceWeb) {
		this.idCardapioSelfServiceWeb = idCardapioSelfServiceWeb;
	}

	public String getCortesia() {
		return this.cortesia;
	}

	public void setCortesia(String cortesia) {
		this.cortesia = cortesia;
	}
	
	public Date getDtInicio() {
		return this.dtInicio;
	}

	public void setDtInicio(Date dtInicio) {
		this.dtInicio = dtInicio;
	}
	
	public Date getDtCadastro() {
		return this.dtCadastro;
	}

	public void setDtCadastro(Date dtCadastro) {
		this.dtCadastro = dtCadastro;
	}


	public Date getDtTermino() {
		return this.dtTermino;
	}

	public void setDtTermino(Date dtTermino) {
		this.dtTermino = dtTermino;
	}

	public String getEntradasFrias() {
		return this.entradasFrias;
	}

	public void setEntradasFrias(String entradasFrias) {
		this.entradasFrias = entradasFrias;
	}

	public String getEntradasQuentes() {
		return this.entradasQuentes;
	}

	public void setEntradasQuentes(String entradasQuentes) {
		this.entradasQuentes = entradasQuentes;
	}

	public String getSobremesa() {
		return this.sobremesa;
	}

	public void setSobremesa(String sobremesa) {
		this.sobremesa = sobremesa;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public RestauranteFilialWeb getRestauranteFilialWeb() {
		return this.restauranteFilialWeb;
	}

	public void setRestauranteFilialWeb(RestauranteFilialWeb restauranteFilialWeb) {
		this.restauranteFilialWeb = restauranteFilialWeb;
	}
	
	public RestauranteSedeWeb getRestauranteSedeWeb() {
		return this.restauranteSedeWeb;
	}

	public void setRestauranteSedeWeb(RestauranteSedeWeb restauranteSedeWeb) {
		this.restauranteSedeWeb = restauranteSedeWeb;
	}
	
	public List<ComposicaoCardSelfServiceWeb> getComposicaoCardSelfServiceWebs() {
		return this.composicaoCardSelfServiceWebs;
	}

	public void setComposicaoCardSelfServiceWebs(List<ComposicaoCardSelfServiceWeb> composicaoCardSelfServiceWebs) {
		this.composicaoCardSelfServiceWebs = composicaoCardSelfServiceWebs;
	}
	
	public String getDiasSemana() {
		return this.diasSemana;
	}

	public void setDiasSemana(String diasSemana) {
		this.diasSemana = diasSemana;
	}

	public String getNomeSelfService() {
		return nomeSelfService;
	}

	public void setNomeSelfService(String nomeSelfService) {
		this.nomeSelfService = nomeSelfService;
	}
	
}